import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import Es6Promise from 'es6-promise';

Es6Promise.polyfill();

/*********** 富文本编辑器 ****************/
import VueQuillEditor from 'vue-quill-editor';

Vue.use(VueQuillEditor);
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
/*********** 实例化内网图片处理功能 ****************/
import defaultImg from './common/defaultImg';

Vue.use(defaultImg);
/*************通用方法**********************/
import common from './common/common';

new common(Vue);
/*********** 引用百度地图 ****************/
import BaiduMap from 'vue-baidu-map';

Vue.use(BaiduMap, {
	ak: 'gY1kboYII6j3lRKfid5xNyNIrMirYDx1'
});

/*********** 封装的 axios 方法 ****************/
import axios from './api/axios';

Vue.prototype.$axios = axios();
/*********** 实例化api接口 ****************/
import api from './api/index';

/*********** 实例化路由处理  全局挂载 ****************/
import route_ from './common/route';

new route_(Vue);

Vue.prototype.$api = api;
/*********** 引用ele ****************/
import ElementUI from 'element-ui';

Vue.use(ElementUI);
Vue.prototype.$message = ElementUI.Message;
import 'element-ui/lib/theme-chalk/index.css';

import moment from 'moment';

/*********** 实例化公共组件 ****************/
import components from './components/index';

components(Vue);

/*********** 字体图标引用 ****************/
import './assets/iconfont/iconfont.css';
import './assets/iconfont/iconfont';

/*********** echarts ****************/
import echarts from 'echarts';

Vue.prototype.$echarts = echarts;


/*********** 配置文件 ****************/
import config_ from './config/config';

Vue.prototype.$config = config_;

Vue.prototype.$moment = moment;
moment.locale('zh-cn');

//刚开始第一次进入页面的时候，为了防止拿不到之前保留的token，先取拿一次内存
localStorage.getItem("store") && store.replaceState(Object.assign(store.state, JSON.parse(localStorage.getItem("store"))));

new Vue({
	router,
	store,
	render: h => h(App)
}).$mount("#app");
